import {checkNumber} from '@/utils/util'

export const TAB_ACCOUNT_DATA = [
    {value:1,lable:'招商银行（企业）' },
    {value:2,lable:'招商银行（园区平台公司）' },
    {value:3,lable:'渤海银行（企业）'},
    { value: 4, lable: '渤海银行（园区平台公司）' },
    { value: 5, lable: '支付宝（企业）' },
    {value:6,lable:'支付宝（园区平台公司）'}
]
export const PARAMS_OPEN_ACCOUNT = [
    {
        type: "a-input",
        field: "keyword",
        title: "公司名称",
        value: "",
        props: {placeholder:"请输入公司名称"}
    },
    {
        type: "RangePicker",
        field: "time",
        title: "日期",
        value: [],
        props: {
            type: "daterange",
            dateFormat: "YYYY-MM-DD",
            "start-placeholder":"开始日期",
            "end-placeholder":"结束日期",
        },
        emit: ['change'],
        emitPrefix: 'btn-time',
    },
    {
        type: "select",
        field: "status",
        title: "开户状态",
         value: "",
        options: [{value:'',label:'全部'},{ value: 1, label: '已开户' }, { value: 2, label: '待激活' }, { value: 3, label: '已销户' }],
        props: { placeholder: "请选择开户状态",style:"width: 100%"}
    },
    {
      type:'a-button',
      field:'search',
      props:{
          type:'primary',
          icon:"search"
      },
      children:['搜索'],
      emit: ['click'],
      emitPrefix: 'btn-search',
    },
    {
      type:'a-button',
      field:'reset',
      props:{
          type:'primary',
          icon:"setting"
      },
      children:['重置'],
      emit: ['click'],
      emitPrefix: 'btn-reset',
    }
]
export const FORM_CMB_ENTERPRISE = [    
     {
        type: "select",
        field: "enterpriseId",
        title: "企业名称",
        value: "",
        options:[],
        props: { placeholder: "请选择企业","filterable": true},
        validate: [
            { required: true, message: "请选择企业", trigger: "change" }
        ],
        emit: ['change'],
        emitPrefix: 'btn-enterprise',
    },
    {
        type: "select",
        field: "parkId",
        title: "关联园区名称",
        value: "",
        options:[],
        props: { placeholder: "请选择关联园区"},
        validate: [
            { required: true, message: "请选择关联园区", trigger: "change" }
        ]
    }
]
export const FORM_CMB_PARK = [
   {
        type: "select",
        field: "parkId",
        title: "园区平台公司（支持搜索）",
        value: "",
        props: { placeholder: "请选择园区平台公司",showSearch:true},
        validate: [
            { required: true, message: "请选择园区平台公司", trigger: "change" }
        ]
    },
    {
        type: "a-input",
        field: "secretKey",
        title: "密钥",
        value: "",
        props: { placeholder: "请输入密钥"},
        validate: [
            { required: true, message: "请输入密钥", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "settlementAccount",
        title: "结算户账号",
        value: "",
        props: { placeholder: "请输入结算户账号"},
        validate: [
            { required: true, message: "请输入结算户账号", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "userNo",
        title: "用户编号",
        value: "",
        props: { placeholder: "请输入用户编号"},
        validate: [
            { required: true, message: "请输入用户编号", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "publicKey",
        title: "公钥",
        value: "",
        props: { placeholder: "请输入公钥"},
        validate: [
            { required: true, message: "请输入公钥", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "privateKey",
        title: "私钥",
        value: "",
        props: { placeholder: "请输入私钥"},
        validate: [
            { required: true, message: "请输入私钥", trigger: "blur" }
        ]
    }
] 

export const FORM_SEA_ENTERPRISE_PARK = [
   {
        type: "select",
        field: "name",
        title: "企业名称（支持搜索）",
        value: "",
        props: { placeholder: "请选择企业名称",showSearch:true},
        validate: [
            { required: true, message: "请选择企业名称", trigger: "change" }
        ],
        emit: ['change'],
        emitPrefix: 'btn-select',
    },
    {
        type: "a-input",
        field: "bankReservedPhone",
        title: "银行办理卡时（预留手机号码）",
        value: "",
        props: { placeholder: "请输入密钥",disabled:true},
        validate: [
            { required: true, message: "请输入密钥", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "legalPersonName",
        title: "真实姓名",
        value: "",
        props: { placeholder: "请输入真实姓名",disabled:true},
        validate: [
            { required: true, message: "请输入真实姓名", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "legalPersonIdCard",
        title: "身份证号码",
        value: "",
        props: { placeholder: "请输入身份证号码",disabled:true},
        validate: [
            { required: true, message: "请输入身份证号码", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "bankCard",
        title: "企业银行账户",
        value: "",
        props: { placeholder: "请输入企业银行账户",disabled:true},
        validate: [
            { required: true, message: "请输入企业银行账户", trigger: "blur" }
        ]
    }
] 
export const FORM_PAY_PARK = [
    {
        type: "select",
        field: "parkId",
        title: "园区名称",
        value: "",
        props: { placeholder: "请选择园区名称",showSearch:true},
        validate: [
            { required: true, message: "请选择园区名称", trigger: "change" }
        ],
    },
    {
        type: "a-input",
        field: "accountName",
        title: "账户名称",
        value: "",
        props: { placeholder: "请输入账户名称",maxLength:26},
        validate: [
            { required: true, message: "请输入账户名称", trigger: "blur" }
        ],
    },
    {
        type: "a-input",
        field: "accountNo",
        title: "默认账号",
        value: "",
        props: { placeholder: "请输入默认账号"},
        validate: [
            { required: true, message: "请输入默认账号", trigger: "blur" }
        ]
    },
]


export const FORM_SEA_ENTERPRISE_PARK_OTHER = [
    {
        type: "a-input",
        field: "name",
        title: "企业名称",
        value: "",
        col: { span: 8 },
        props: { placeholder: "请输入企业名称", disabled: true},
        validate: [
            { required: true, message: "请输入企业名称", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "legalPersonName",
        title: "法人姓名",
        value: "",
        col: { span: 8 },
        props: { placeholder: "请输入法人姓名", disabled: true },
        validate: [
            { required: true, message: "请输入法人姓名", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "legalPersonPhone",
        title: "法人手机号码",
        value: "",
        col: { span: 8 },
        props: { placeholder: "请输入法人手机号码", disabled: true },
        validate: [
            { required: true, message: "请输入法人手机号码", trigger: "blur" }
        ]
    },
        {
        type: "a-input",
        field: "legalPersonIdCard",
        title: "法人身份证号码",
            value: "",
        col: { span: 8 },
        props: { placeholder: "请输入法人身份证号码", disabled: true },
        validate: [
            { required: true, message: "请输入法人身份证号码", trigger: "blur" }
        ]
    },
        {
        type: "a-input",
        field: "creditCode",
        title: "统一信用代码",
            value: "",
        col: { span: 8 },
        props: { placeholder: "请输入统一信用代码", disabled: true },
        validate: [
            { required: true, message: "请输入统一信用代码", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "email",
        title: "邮箱",
        value: "",
        col: { span: 8 },
        props: { placeholder: "请输入邮箱" },
        validate: [
            {
                validator: (rule, val, d) => {
                    val && !/^[a-zA-Z0-9_-]+@([a-zA-Z0-9]+\.)+(com|cn|net|org)$/.test(val) ? d(true) : d();
                },
                message: "邮箱格式错误"
            }
        ]
    },
    {
        type: "a-input",
        field: "name",
        title: "虚拟户户名",
        value: "",
        col: { span: 8 },
        props: { placeholder: "请输入虚拟户户名", disabled: true },
        validate: [
            { required: true, message: "请输入虚拟户户名", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "bankNum",
        title: "企业账户开户行行号",
        value: "",
        col: { span: 8 },
        props: { placeholder: "请输入企业账户开户行行号" },
        validate: [
            { required: true, message: "请输入企业账户开户行行号", trigger: "blur" }
        ]
    },
    {
        type: "a-input",
        field: "postcodeOther",
        title: "邮编",
        value: "",
        col: { span: 8 },
        validate: [
            {
                validator: (rule, val, d) => {
                    const reg = /^[0-9]{6}$/
                    val && !reg.test(val) ? d(true) : d()
                }, message: '邮编格式错误'
            }
        ]
    },
    {
        type: "radio",
        field: "isBhAccount",
        title: "是否渤海账号",
        value: '',
        options: [{ value: 2, label: '否' }, { value: 1, label: '是' }],
        col: { span: 24 },
        validate: [
            { required: true, message: "请选择是否渤海账号", trigger: "change" },
        ],
        emit: ['change'],
        emitPrefix: 'btn-radio',
    },
    {
        type:"a-input",
        field:"bankCard",
        title:"企业账户账号",
        value:"",
        props: { disabled: true },
            col: { span: 12 },
        validate: [
        { required: true, message: "请输入企业账户账号", trigger: "blur" },
        ],
    },
    {
        type:"a-input",
        field:"accountName",
        title:"企业账户户名",
        value:"",
        props: { disabled: true },
            col: { span: 12 },
        validate: [
        { required: true, message: "请输入企业账户户名", trigger: "blur" },
        ],
    },
    {
        type:"a-input",
        field:"bankTypeOther",
        title:"企业账户开户户型",
        value: "",
            col: { span: 12 },
        props:{"placeholder":"请输入企业账户开户户型"},
    },
    {
        type:"a-input",
        field:"bankNameOther",
        title: "企业账户开户行名",
            col: { span: 12 },
        value:"",
        props:{"placeholder":"请输入企业账户开户行名"},
    }
] 


export const COLUMNS_CMB_PARK = [
     {
        title: '园区平台公司名称',
        dataIndex: 'name',
        scopedSlots: { customRender: 'plipayParkName' }
    },
    {
        title: '支付通道',
        dataIndex: 'payChannel',
        customRender: (text, row, index) => {
            if (row.payChannel === 1) {
                return '招商银行'
            } else if (row.payChannel === 2){
                return '渤海银行'
            }
            return ''
        },
    },
    {
        title: '开户账号',
        dataIndex: 'accountNo',
        scopedSlots: { customRender: 'accountNo' }
    },
    {
        title: '状态',
        dataIndex: 'statusName'
    },
     {
        title: '更新时间',
        dataIndex: 'updatedTime',
    },
    {
        title: '操作',
        dataIndex: 'action',
        scopedSlots: { customRender: 'action' }
    }
];

export const COLUMNS_CMB_ENTERPRISE = [
    {
        title: '企业名称',
        dataIndex: 'name',
        scopedSlots: { customRender: 'name' }
    },
    {
        title: '园区平台公司名称',
        dataIndex: 'parkName',
        scopedSlots: { customRender: 'parkName' }
    },
    {
        title: '支付通道',
        dataIndex: 'payChannel',
        customRender: (text, row, index) => {
            if (row.payChannel === 1) {
                return '招商银行'
            } else if (row.payChannel === 2){
                return '渤海银行'
            }
            return ''
        },
    },
    {
        title: '子账户账号',
        dataIndex: 'accountNo',
        scopedSlots: { customRender: 'accountNo' }
    },
    {
        title: '父级账户账户',
        dataIndex: 'parentAccountNo',
        scopedSlots: { customRender: 'parentAccountNo' }
    },
    {
        title: '账户余额',
        dataIndex: 'balance',
        scopedSlots: { customRender: 'balance' }
    },
    {
        title: '状态',
        dataIndex: 'statusName'
    },
     {
        title: '状态更新时间',
        dataIndex: 'updatedTime',
    },
    {
        title: '操作',
        dataIndex: 'action',
        scopedSlots: { customRender: 'action' }
    }
]
export const COLUMNS_SEA_PARK = [
     {
        title: '园区平台公司名称',
        dataIndex: 'name',
        scopedSlots: { customRender: 'name' }
    },
    {
        title: '支付通道',
        dataIndex: 'payChannel',
        customRender: (text, row, index) => {
            if (row.payChannel === 1) {
                return '招商银行'
            } else if (row.payChannel === 2){
                return '渤海银行'
            }
            return '-'
        },
    },
    {
        title: '虚拟账户账号',
        dataIndex: 'accountNo',
        scopedSlots: { customRender: 'accountNo' }
    },
    {
        title: '关联对公账号',
        dataIndex: 'corporateAccount',
        scopedSlots: { customRender: 'corporateAccount' }
    },
    {
        title: '虚拟账户余额',
        dataIndex: 'balance',
        scopedSlots: { customRender: 'balance' }
    },
    {
        title: '状态',
        dataIndex: 'statusName',
       /*  customRender: (text, row, index) => {
            if (row.status === 1) {
                return '启用'
            } else if (row.status === 2){
                return '禁用'
            }
            return ''
        }, */
    },
     {
        title: '状态更新时间',
        dataIndex: 'updatedTime',
    },
    {
        title: '操作',
        dataIndex: 'action',
        scopedSlots: { customRender: 'action' }
    }
];
export const COLUMNS_SEA_ENTERPRISE = [
     {
        title: '企业名称',
        dataIndex: 'name',
        scopedSlots: { customRender: 'name' }
    },
    {
        title: '支付通道',
        dataIndex: 'payChannel',
        customRender: (text, row, index) => {
            if (row.payChannel === 1) {
                return '招商银行'
            } else if (row.payChannel === 2){
                return '渤海银行'
            }
            return '-'
        },
    },
    {
        title: '虚拟账户账号',
        dataIndex: 'accountNo',
        scopedSlots: { customRender: 'accountNo' }
    },
    {
        title: '关联对公账号',
        dataIndex: 'corporateAccount',
        scopedSlots: { customRender: 'corporateAccount' }
    },
    {
        title: '虚拟账户余额',
        dataIndex: 'balance',
        scopedSlots: { customRender: 'balance' }
    },
    {
        title: '状态',
        dataIndex: 'statusName',
       /*  customRender: (text, row, index) => {
            if (row.status === 1) {
                return '启用'
            } else if (row.status === 2){
                return '禁用'
            }
            return ''
        }, */
    },
     {
        title: '状态更新时间',
        dataIndex: 'updatedTime',
    },
    {
        title: '操作',
        dataIndex: 'action',
        scopedSlots: { customRender: 'action' }
    }
];

export const COLUMNS_ALIPAY_ENTERPRISE = [
    {
        title: '企业名称',
        dataIndex: 'name',
        scopedSlots: { customRender: 'name' }
    },
    {
        title: '园区平台公司名称',
        dataIndex: 'parkName',
        scopedSlots: { customRender: 'parkName' }
    },
    {
        title: '开户账号',
        dataIndex: 'accountNo',
        scopedSlots: { customRender: 'accountNo' }
    },
    {
        title: '账户余额',
        dataIndex: 'balance',
        scopedSlots: { customRender: 'balance' }
    },
    {
        title: '状态',
        dataIndex: 'statusName'
    },
     {
        title: '开户时间',
        dataIndex: 'updatedTime',
    },
     {
        title: '操作',
        dataIndex: 'action',
        scopedSlots: { customRender: 'action' }
    }
]
export const COLUMNS_ALIPAY_PARK = [
   /*  {
        title: '园区平台公司名称',
        dataIndex: 'name',
        scopedSlots: { customRender: 'plipayParkName' }
    }, */
    {
        title: '开户账号',
        dataIndex: 'accountNo',
        scopedSlots: { customRender: 'accountNo' }
    },
    {
        title: '账号名称',
        dataIndex: 'name',
    },
    {
        title: '状态',
        dataIndex: 'statusName'
    },
     {
        title: '开户时间',
        dataIndex: 'updatedTime',
    },
     {
        title: '操作',
        dataIndex: 'action',
        scopedSlots: { customRender: 'action' }
    }
]


 export const OPTION_INLINE = {
    form: {layout: 'inline'},
    resetBtn: false,
    submitBtn: false
  }
  export const OPTION_BLOCK= {
    form: { layout: "vertical" },
    row:{gutter: 20},
    resetBtn: false,
    submitBtn: false
  }
 